package com.qinggeng.project.system.service.impl;

import java.util.List;

import com.qinggeng.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.qinggeng.project.system.mapper.AssistHelpMapper;
import com.qinggeng.project.system.domain.AssistHelp;
import com.qinggeng.project.system.service.IAssistHelpService;

/**
 * 帮助力Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-11-09
 */
@Service
public class AssistHelpServiceImpl implements IAssistHelpService 
{
    @Autowired
    private AssistHelpMapper assistHelpMapper;

    /**
     * 查询帮助力
     * 
     * @param id 帮助力ID
     * @return 帮助力
     */
    @Override
    public AssistHelp selectAssistHelpById(Long id)
    {
        return assistHelpMapper.selectAssistHelpById(id);
    }

    /**
     * 查询帮助力列表
     * 
     * @param assistHelp 帮助力
     * @return 帮助力
     */
    @Override
    public List<AssistHelp> selectAssistHelpList(AssistHelp assistHelp)
    {
        return assistHelpMapper.selectAssistHelpList(assistHelp);
    }

    /**
     * 新增帮助力
     * 
     * @param assistHelp 帮助力
     * @return 结果
     */
    @Override
    public int insertAssistHelp(AssistHelp assistHelp)
    {
        assistHelp.setCreateTime(DateUtils.getNowDate());
        return assistHelpMapper.insertAssistHelp(assistHelp);
    }

    /**
     * 修改帮助力
     * 
     * @param assistHelp 帮助力
     * @return 结果
     */
    @Override
    public int updateAssistHelp(AssistHelp assistHelp)
    {
        return assistHelpMapper.updateAssistHelp(assistHelp);
    }

    /**
     * 批量删除帮助力
     * 
     * @param ids 需要删除的帮助力ID
     * @return 结果
     */
    @Override
    public int deleteAssistHelpByIds(Long[] ids)
    {
        return assistHelpMapper.deleteAssistHelpByIds(ids);
    }

    /**
     * 删除帮助力信息
     * 
     * @param id 帮助力ID
     * @return 结果
     */
    @Override
    public int deleteAssistHelpById(Long id)
    {
        return assistHelpMapper.deleteAssistHelpById(id);
    }
    /**
     * 查询用户当天帮助力记录
     * @param assistHelp
     * @return
     */
    @Override
    public List<AssistHelp> selectAssistHelpListByToday(AssistHelp assistHelp) {
        return assistHelpMapper.selectAssistHelpListByToday(assistHelp);
    }
}
